package com.pjh.shitang.utils.vo.returns;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author yueyinghaibao
 * @date 2022/5/1
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResponseBody<T> {
    String msg;
    Integer code;
    T data;

    public static<T> ResponseBody<T> success () {
        return new ResponseBody<>("success", 200, null);
    }

    public static<T> ResponseBody<T> success (T data) {
        return new ResponseBody<>("success", 200, data);
    }

    public static<T> ResponseBody<T> error (String e) {
        return new ResponseBody<>(e, 500, null);
    }

}
